package org.tuoren.official.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.tuoren.common.core.validate.AddGroup;
import org.tuoren.common.core.validate.EditGroup;
import org.tuoren.common.mybatis.core.domain.BaseEntity;
import org.tuoren.official.domain.Annex;
import org.tuoren.official.domain.TNewsCenter;

import java.util.Date;
import java.util.List;

/**
 * 新闻中心配置业务对象 t_news_center
 *
 * @author Lion Li
 * @since 2024-11-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TNewsCenter.class, reverseConvertGenerate = false)
public class TNewsCenterBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 新闻类型（0:新闻动态、1:媒体动态、2:影像驼人、3:通知公告）
     */
    @NotNull(message = "新闻类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String newType;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;

    /**
     * 置顶图地址
     */
    private String topUrl;
    /**
     * 移动端标题
     */
    private String appTitle;

    /**
     * 移动端置顶图地址
     */
    private String appTopUrl;

    /**
     * 封面图地址
     */
    private String coverUrl;

    /**
     * 描述
     */
    @NotBlank(message = "描述不能为空", groups = { AddGroup.class, EditGroup.class })
    private String newDesc;

    /**
     * 内容
     */
//    @NotBlank(message = "内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String content;

    /**
     * 来源
     */
    private String source;

    /**
     * 资源地址
     */
//    @NotBlank(message = "资源地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String mediumUrl;

    /**
     * 发布时间
     */
//   @NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
//    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date publishDate;

    /**
     * 是否置顶（0：否；1：是）
     */
    @NotBlank(message = "是否置顶不能为空", groups = { AddGroup.class, EditGroup.class })
    private String isTop;

    private Date publishDateFormat;

    /**
     * 是否发布（0：否；1：是）
     */
    private String isPublish;
    /**
     * 附件
     */
    private List<Annex> annexList;

}
